package itheima.edu.info.arraylist.centual;

import java.util.ArrayList;
import java.util.Iterator;

public class IteratorText {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("ddd");
        Iterator<String> iterator=list.iterator();
       // list.add("eee");
       while (iterator.hasNext()){
           String next = iterator.next();
           System.out.println(next);
       }
    }
}
